<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交网站弹出举报操作表单</title>
    <!-- Bootstrap 5 CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    
    <style>
        :root {
            --primary: #4F46E5;
            --danger: #EF4444;
            --gray: #6B7280;
            --light-gray: #F3F4F6;
            --dark-gray: #374151;
            --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            --radius: 10px;
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            padding: 2rem;
            background-color: #F9FAFB;
        }
        
        .container {
            max-width: 800px;
        }
        
        .card {
            border: none;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
        }
        
        /* 帖子样式 */
        .post-header {
            display: flex;
            align-items: center;
            padding: 1.25rem;
            gap: 1rem;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .user-info {
            flex: 1;
        }
        
        .user-name {
            font-weight: 600;
            margin-bottom: 0;
        }
        
        .post-time {
            font-size: 0.85rem;
            color: var(--gray);
        }
        
        .post-content {
            padding: 0 1.25rem 1rem;
        }
        
        .post-image {
            width: 100%;
            height: 300px;
            object-fit: cover;
            margin-bottom: 1rem;
        }
        
        .post-text {
            margin-bottom: 1rem;
            line-height: 1.6;
        }
        
        .post-actions {
            display: flex;
            border-top: 1px solid var(--light-gray);
            border-bottom: 1px solid var(--light-gray);
        }
        
        .action-btn {
            flex: 1;
            padding: 0.75rem;
            background: none;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            color: var(--gray);
            font-weight: 500;
            transition: all 0.2s ease;
        }
        
        .action-btn:hover {
            background-color: var(--light-gray);
            color: var(--primary);
        }
        
        .action-btn.report-btn:hover {
            color: var(--danger);
        }
        
        .action-btn i {
            font-size: 1.1rem;
        }
        
        /* 举报弹窗样式 */
        .report-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: flex-end;
            justify-content: center;
            z-index: 1050;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }
        
        .report-backdrop.active {
            opacity: 1;
            visibility: visible;
        }
        
        .report-modal {
            background-color: white;
            width: 100%;
            max-width: 600px;
            border-radius: var(--radius) var(--radius) 0 0;
            padding: 1.5rem;
            transform: translateY(100%);
            transition: transform 0.3s ease;
            max-height: 90vh;
            overflow-y: auto;
        }
        
        .report-backdrop.active .report-modal {
            transform: translateY(0);
        }
        
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }
        
        .modal-title {
            font-size: 1.25rem;
            font-weight: 600;
            margin: 0;
            color: var(--danger);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        
        .close-btn {
            background: none;
            border: none;
            font-size: 1.5rem;
            color: var(--gray);
            cursor: pointer;
            transition: color 0.2s ease;
        }
        
        .close-btn:hover {
            color: var(--dark-gray);
        }
        
        /* 举报表单样式 */
        .report-form-group {
            margin-bottom: 1.5rem;
        }
        
        .form-label {
            display: block;
            font-weight: 500;
            margin-bottom: 0.75rem;
            color: var(--dark-gray);
        }
        
        .form-hint {
            font-size: 0.85rem;
            color: var(--gray);
            margin-top: 0.25rem;
        }
        
        .report-textarea {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid #ddd;
            border-radius: var(--radius);
            min-height: 120px;
            resize: vertical;
            font-family: inherit;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
        }
        
        .report-textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
        }
        
        .char-count {
            text-align: right;
            font-size: 0.85rem;
            color: var(--gray);
            margin-top: 0.5rem;
        }
        
        .report-reasons {
            margin-bottom: 1.5rem;
        }
        
        .reason-options {
            display: grid;
            grid-template-columns: 1fr;
            gap: 0.75rem;
        }
        
        .reason-item {
            position: relative;
            padding: 1rem;
            border: 1px solid #ddd;
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .reason-item:hover {
            border-color: var(--primary);
            background-color: rgba(79, 70, 229, 0.03);
        }
        
        .reason-item input {
            position: absolute;
            opacity: 0;
            cursor: pointer;
        }
        
        .checkmark {
            position: absolute;
            top: 1.25rem;
            right: 1rem;
            height: 20px;
            width: 20px;
            border-radius: 50%;
            border: 2px solid #ddd;
            transition: all 0.2s ease;
        }
        
        .reason-item input:checked ~ .checkmark {
            background-color: var(--primary);
            border-color: var(--primary);
        }
        
        .checkmark:after {
            content: "";
            position: absolute;
            display: none;
        }
        
        .reason-item input:checked ~ .checkmark:after {
            display: block;
        }
        
        .reason-item .checkmark:after {
            left: 6px;
            top: 6px;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: white;
        }
        
        .reason-title {
            font-weight: 500;
            margin-bottom: 0.25rem;
        }
        
        .reason-description {
            font-size: 0.85rem;
            color: var(--gray);
        }
        
        .action-buttons {
            display: flex;
            gap: 1rem;
            margin-top: 1.5rem;
        }
        
        .cancel-btn {
            flex: 1;
            padding: 1rem;
            background-color: white;
            border: 1px solid var(--light-gray);
            border-radius: var(--radius);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .cancel-btn:hover {
            background-color: var(--light-gray);
        }
        
        .submit-report-btn {
            flex: 1;
            padding: 1rem;
            background-color: var(--danger);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        
        .submit-report-btn:hover {
            background-color: #DC2626;
        }
        
        .submit-report-btn:disabled {
            background-color: var(--gray);
            cursor: not-allowed;
        }
        
      
        
        /* 举报内容预览 */
        .report-preview {
            background-color: var(--light-gray);
            border-radius: var(--radius);
            padding: 1rem;
            margin-bottom: 1.5rem;
        }
        
        .preview-title {
            font-weight: 500;
            margin-bottom: 0.75rem;
            font-size: 0.9rem;
            color: var(--gray);
        }
        
        .preview-content {
            background-color: white;
            border-radius: 8px;
            padding: 1rem;
            font-size: 0.9rem;
            border: 1px solid #eee;
            max-height: 150px;
            overflow: hidden;
        }
    </style>
</head>
<body>
    <div class="container">
        <div class="card">
            <!-- 帖子内容 -->
            <div class="post-header">
                <img src="https://picsum.photos/id/64/40/40" alt="用户头像" class="user-avatar">
                <div class="user-info">
                    <p class="user-name">李明</p>
                    <p class="post-time">今天 14:30</p>
                </div>
            </div>
            
            <div class="post-content">
                <p class="post-text">刚刚发现了一个超棒的新功能，迫不及待想和大家分享！这个工具真的帮我省了很多时间，强烈推荐给大家～</p>
                <img src="https://picsum.photos/id/26/800/300" alt="帖子图片" class="post-image">
            </div>
            
            <!-- 操作按钮 -->
            <div class="post-actions">
                <button class="action-btn like-btn">
                    <i class="far fa-heart"></i>
                    <span>点赞</span>
                </button>
                <button class="action-btn comment-btn">
                    <i class="far fa-comment"></i>
                    <span>评论</span>
                </button>
                <button class="action-btn share-btn">
                    <i class="far fa-share-square"></i>
                    <span>分享</span>
                </button>
                <button class="action-btn report-btn" id="reportBtn">
                    <i class="far fa-flag"></i>
                    <span>举报</span>
                </button>
            </div>
        </div>
    </div>
    
    <!-- 举报弹窗表单 -->
    <div class="report-backdrop" id="reportModal">
        <div class="report-modal">
            <div class="modal-header">
                <h3 class="modal-title">
                    <i class="fas fa-exclamation-triangle"></i>
                    举报内容
                </h3>
                <button class="close-btn" id="closeModal">&times;</button>
            </div>
            
            <!-- 举报内容预览 -->
            <div class="report-preview">
                <div class="preview-title">举报内容预览</div>
                <div class="preview-content">
                    <p>刚刚发现了一个超棒的新功能，迫不及待想和大家分享！这个工具真的帮我省了很多时间，强烈推荐给大家～</p>
                    <div class="text-muted">—— 李明</div>
                </div>
            </div>
            
            <!-- 举报表单 -->
            <form id="reportForm">
                <!-- 举报原因选择 -->
                <div class="report-form-group report-reasons">
                    <label class="form-label">选择举报原因（必选）</label>
                    <p class="form-hint">请选择最符合的举报原因，这将帮助我们更快处理</p>
                    
                    <div class="reason-options">
                        <div class="reason-item">
                            <input type="radio" name="reason" id="reason1" value="spam">
                            <label for="reason1">
                                <div class="reason-title">垃圾信息或广告</div>
                                <div class="reason-description">包括未经请求的推广、重复发布的内容等</div>
                            </label>
                            <span class="checkmark"></span>
                        </div>
                        
                        <div class="reason-item">
                            <input type="radio" name="reason" id="reason2" value="inappropriate">
                            <label for="reason2">
                                <div class="reason-title">不适当内容或骚扰</div>
                                <div class="reason-description">包括侮辱性语言、骚扰或令人不适的内容</div>
                            </label>
                            <span class="checkmark"></span>
                        </div>
                        
                        <div class="reason-item">
                            <input type="radio" name="reason" id="reason3" value="violence">
                            <label for="reason3">
                                <div class="reason-title">暴力或危险内容</div>
                                <div class="reason-description">包括宣扬暴力、自残或危险行为的内容</div>
                            </label>
                            <span class="checkmark"></span>
                        </div>
                        
                        <div class="reason-item">
                            <input type="radio" name="reason" id="reason4" value="copyright">
                            <label for="reason4">
                                <div class="reason-title">侵犯版权或知识产权</div>
                                <div class="reason-description">包括未经授权使用的受版权保护的内容</div>
                            </label>
                            <span class="checkmark"></span>
                        </div>
                        
                        <div class="reason-item">
                            <input type="radio" name="reason" id="reason5" value="misinformation">
                            <label for="reason5">
                                <div class="reason-title">虚假信息</div>
                                <div class="reason-description">包括故意传播的虚假或误导性信息</div>
                            </label>
                            <span class="checkmark"></span>
                        </div>
                        
                        <div class="reason-item">
                            <input type="radio" name="reason" id="reason6" value="other">
                            <label for="reason6">
                                <div class="reason-title">其他原因</div>
                                <div class="reason-description">不属于上述类别的问题</div>
                            </label>
                            <span class="checkmark"></span>
                        </div>
                    </div>
                </div>
                
                <!-- 详细说明 -->
                <div class="report-form-group">
                    <label for="reportDetails" class="form-label">详细说明（可选）</label>
                    <p class="form-hint">请提供更多细节，帮助我们更好地理解问题所在</p>
                    <textarea id="reportDetails" class="report-textarea" placeholder="请详细描述您举报的原因..."></textarea>
                    <div class="char-count"><span id="charCount">0</span>/500</div>
                </div>
                
                <!-- 操作按钮 -->
                <div class="action-buttons">
                    <button type="button" class="cancel-btn" id="cancelBtn">取消</button>
                    <button type="submit" class="submit-report-btn" id="submitReportBtn" disabled>
                        <i class="fas fa-paper-plane"></i>
                        <span>提交举报</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
    

    <!-- Bootstrap 5 JS Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // 获取DOM元素
            const reportBtn = document.getElementById('reportBtn');
            const reportModal = document.getElementById('reportModal');
            const closeModal = document.getElementById('closeModal');
            const cancelBtn = document.getElementById('cancelBtn');
            const toastNotification = document.getElementById('toastNotification');
            const reportForm = document.getElementById('reportForm');
            const reportDetails = document.getElementById('reportDetails');
            const charCount = document.getElementById('charCount');
            const submitReportBtn = document.getElementById('submitReportBtn');
            const reasonInputs = document.querySelectorAll('input[name="reason"]');
            
            // 打开举报弹窗
            reportBtn.addEventListener('click', function() {
                reportModal.classList.add('active');
                document.body.style.overflow = 'hidden'; // 防止背景滚动
                // 重置表单
                resetForm();
            });
            
            // 关闭举报弹窗
            function closeReportModal() {
                reportModal.classList.remove('active');
                document.body.style.overflow = ''; // 恢复背景滚动
            }
            
            closeModal.addEventListener('click', closeReportModal);
            cancelBtn.addEventListener('click', closeReportModal);
            
            // 点击弹窗外部关闭
            reportModal.addEventListener('click', function(e) {
                if (e.target === reportModal) {
                    closeReportModal();
                }
            });
            
            // 字符计数
            reportDetails.addEventListener('input', function() {
                const count = this.value.length;
                charCount.textContent = count;
                
                // 限制最大字符数
                if (count > 500) {
                    this.value = this.value.substring(0, 500);
                    charCount.textContent = 500;
                }
            });
            
            // 监听举报原因选择，更新提交按钮状态
            reasonInputs.forEach(input => {
                input.addEventListener('change', updateSubmitButton);
            });
            
            // 更新提交按钮状态
            function updateSubmitButton() {
                const selectedReason = document.querySelector('input[name="reason"]:checked');
                submitReportBtn.disabled = !selectedReason;
            }
            
            // 表单提交
            reportForm.addEventListener('submit', function(e) {
                e.preventDefault();
                
                const selectedReason = document.querySelector('input[name="reason"]:checked');
                if (!selectedReason) {
                    showToast('请选择举报原因', false);
                    return;
                }
                
                // 获取表单数据
                const reportData = {
                    reason: selectedReason.value,
                    details: reportDetails.value.trim()
                };
                
                // 在实际应用中，这里会发送举报数据到服务器
                console.log('提交举报:', reportData);
                
                // 关闭弹窗
                closeReportModal();
                
                // 显示成功提示
                showToast('举报已提交，我们会尽快处理');
            });
            
         
            // 重置表单
            function resetForm() {
                reportDetails.value = '';
                charCount.textContent = '0';
                reasonInputs.forEach(input => input.checked = false);
                updateSubmitButton();
            }
            
            // 其他交互效果 - 点赞、评论、分享按钮
            const likeBtn = document.querySelector('.like-btn');
            const commentBtn = document.querySelector('.comment-btn');
            const shareBtn = document.querySelector('.share-btn');
            
            likeBtn.addEventListener('click', function() {
                const icon = this.querySelector('i');
                if (icon.classList.contains('far')) {
                    icon.classList.remove('far');
                    icon.classList.add('fas', 'text-danger');
                    this.querySelector('span').textContent = '已点赞';
                } else {
                    icon.classList.remove('fas', 'text-danger');
                    icon.classList.add('far');
                    this.querySelector('span').textContent = '点赞';
                }
            });
            
            shareBtn.addEventListener('click', function() {
                showToast('分享功能已触发');
            });
            
            commentBtn.addEventListener('click', function() {
                showToast('评论区已打开');
            });
            
            // 初始化
            updateSubmitButton();
        });
    </script>
</body>
</html>
    
